import java.awt.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.List;
import javax.swing.*;

import java.awt.event.*;

public class Photos extends JPanel implements MouseListener, MouseMotionListener{
	private Image background,frame,next;
	private int goNext=0;
	private JComboBox sorty, jumpy;
	private String[] jump ={"test1","test2"};
	private String[] sort ={"sort1","sort2"};
	
	public Photos(){
		setLayout(null);
		sorty = new JComboBox(sort);
		jumpy = new JComboBox(jump);
		loadImages();
		sorty.setBounds(130,20,110,35);
		jumpy.setBounds(640,450,110,35);
		add(sorty);
		add(jumpy);
	}
	
	 public void loadImages(){
	       try{
	           background = new ImageIcon("pics/stan_bg.png").getImage();
	           frame = new ImageIcon("pics/frame.png").getImage();
	           next = new ImageIcon("pics/next.png").getImage();
	          
	        } catch (Exception e) { }
	       
	       repaint();
	   }
	   
	   public void paintComponent(Graphics g){
	       super.paintComponent(g);
	       Graphics2D g2d = (Graphics2D) g;
	       setForeground(Color.red);
	       setFont(new Font("Arial",Font.BOLD,25));
	       g2d.drawImage(background, 0, 0, this);
	       g2d.drawString("Sort by:", 20, 40);
	       g2d.drawImage(frame, 30, 90,this);
	       g2d.drawImage(frame, 230, 90,this);
	       g2d.drawImage(frame, 430, 90,this);
	       g2d.drawImage(frame, 630, 90,this);
	       g2d.drawImage(frame, 30, 250,this);
	       g2d.drawImage(frame, 230, 250,this);
	       g2d.drawImage(frame, 430, 250,this);
	       g2d.drawImage(frame, 630, 250,this);
	       g2d.drawImage(next, 600, 410,this);
	       g2d.drawString("Jump to page:", 460, 475);
	   }
	   
	   public void setGoNext(int d){
		   goNext=1;
	   }
	   
	   public int getGoNext(){
		  return goNext; 
	   }
	   
	   public void Loopy(){
			while(goNext!=1)
				repaint();
			}
	   
	   public void mouseClicked(MouseEvent me) {
		   	
	   }
	   public void mousePressed(MouseEvent me) {
	       
	   }
	   public void mouseReleased(MouseEvent me) {
	       
	   }
	   public void mouseDragged(MouseEvent me) {
	       
	   }
	   public void mouseMoved(MouseEvent me) {
	   
	   }    
	   public void mouseEntered(MouseEvent me) {
	       
	   }
	   public void mouseExited(MouseEvent me) {
	       
	   }
}
